<!doctype html>
<html>
<head>
	<meta charset="utf-8"><meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
	<title>我的订单</title>
	<link rel="stylesheet" type="text/css" href="../../lib/css/skin.css"/>
</head>
<body>
<div id="root">
	<div class="app_warp">
		<div class="app_head">
			<span class="left back"></span>
			<span class="name">我的订单</span>
			<span class="right">
				<a href="javascript:;" class="logout" style="display: none" tapmode onclick="logout()">退出</a>
			</span>
		</div>
		<div class="app_main">
			<div class="space"></div>
			<div id="nocontent" class="nocontent animated fadeInUp hide">
				<img src="../../lib/img/nocomment.png" alt="">
				<div class="text">
					当前没有订单
				</div>
			</div>
			<div id="noready" class="nocontent animated fadeInUp">
				<img src="../../lib/img/loading.gif" class="minimize" alt="">
				<div class="text minimize">
					准备订单数据
				</div>
			</div>

			<ul id="order_list" class="order_list animated fadeInUp hide"></ul>
		</div>
	</div>
</div>
<script id="order_list_template" type="text/html">
	<%for(var i in data){ var _data_ = data[i] %>
	<li>
		<div class="view_orderli" tapmode onclick="getPage(<%:=_data_.id%>)">
			<span class="order_id">
				订单编号 : <%:=_data_.ordersn%>
			</span>
			<p class="order_col in">
				<img src="<%:=_data_.avatar%>" alt="" class="order_cover imagecache">
				<span class="order_readmore">
					查看详情
				</span>
			</p>
			<p class="order_col clearfix">
				<span class="order_name">
					<%:=_data_.lname%>
				</span>
				<span class="order_expense">
					<%:=_data_.price%> / 报名费
				</span>
				<span class="order_time">
					<%:=_data_.time%>
				</span>
				<span class="order_status">
					<%:=_data_.status%>
				</span>
			</p>
			<p class="order_col">
				<span class="order_settlement">
					共一个报名费，合计 ¥<%:=_data_.price%>
				</span>
			</p>
		</div>
		<div style="height: 1rem"></div>
	</li>
	<%}%>
</script>
<script>
	var _data_,
		getPage = function (id) {
			for (var i in _data_.data) {
				if (_data_.data[i].id == id) {
					api.openWin({
						name: 'dingdan_view',
						url: './dingdan_view.html',
						pageParam: _data_.data[i]
					})
				}
			}
		},
		ajax = function () {
			var setting = {
				interface: 'search',
				data: {
					tag: 'user_order_list'
				},
				call: function (data) {
					if (data.status === 200) {
						_data_ = data;
						_$.template('order_list_template', data, function (html) {
							var list = $('#order_list');
							list.html(html);
							_$.sleep(function () {
								list.removeClass('hide');
								$('.nocontent').addClass('hide');
							}, 500)
						})
					} else {
						$('.nocontent,#nocontent').toggleClass('hide');
					}
				}
			}
			_$.ajax(setting)
		},
		appready = function () {
			ajax();
		};
</script>
<script src="../../lib/js/config.js"></script>
<script src="../../lib/js/jquery.js"></script>
<script src="../../lib/js/common.js"></script>
</body>
</html>